package com.polytech.utils;
public class MySqlDataSource extends DataSource {

	public static final String BRIDGE="jdbc:mysql:";
	private String source;
	private String host;
	public MySqlDataSource() {
		
	}
	public MySqlDataSource(String source,String host,String user,String password) {
		this.host=host;
		this.source=source;
		setUser(user);
		setPassword(password);
		setUrl(BRIDGE+"//"+host+"/"+source);
		setDriver("com.mysql.jdbc.Driver");
	}
	public MySqlDataSource(String source,String user,String password) {
		this(source, "127.0.0.1", user, password);
	}
	public MySqlDataSource(String source) {
		this(source,"127.0.0.1", "root", "");
	}
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
		setUrl(BRIDGE+"//"+host+"/"+source);
	}
	public String getHost() {
		return host;
	}
	public void setHost(String host) {
		this.host = host;
		setUrl(BRIDGE+"//"+host+"/"+source);
	}
	
}
